Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add jump DDOS protection #710

Merged
merged 1 commit into from
Oct 8, 2024
Merged

fix: Add jump DDOS protection #710

merged 1 commit into from
Oct 8, 2024

Conversation

Nashtare
Copy link
Collaborator

@Nashtare Nashtare commented Oct 8, 2024

We were currently allowing any u32 destination for JUMP / JUMPI opcodes. This is wasteful and a DDOS vector, as this forces us to allocate possible huge chunks of memory for each traversed context, if we call an invalid JUMP to say u32::MAX.

Given that we know contract bytecodes are limited (0x6000 bytes for Eth mainnet / 0x8000 for Polygon PoS), we can change the check to this instead.

Added a regression test (block 978 of the test chain), that requires both:

  • this PR (txns containing 0x0000000000000000000000000000000000000000000000000000000000000401 in their inputs, 6 in this block)
  • Fix contract call reversion  #709 (txn 43)

4.5/N @praetoriansentry

@Nashtare Nashtare self-assigned this Oct 8, 2024
@Nashtare Nashtare added this to the Testing and Validation milestone Oct 8, 2024
@github-actions github-actions bot added crate: trace_decoder Anything related to the trace_decoder crate. crate: evm_arithmetization Anything related to the evm_arithmetization crate. labels Oct 8, 2024
@Nashtare Nashtare merged commit 414519d into develop Oct 8, 2024
20 checks passed
@Nashtare Nashtare deleted the fix/ddos_jump branch October 8, 2024 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate: evm_arithmetization Anything related to the evm_arithmetization crate. crate: trace_decoder Anything related to the trace_decoder crate.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants